package service.impl;

import dao.CustomerDao;
import dao.impl.CustomerDaoImpl;
import pojo.Customer;
import service.CustomerManager;

public enum CustomerManagerFactory implements CustomerManager {
	INSTANCE;
	
	private CustomerDao customerDao = new CustomerDaoImpl();

	@Override
	public Customer login(String cname, String passwd) {
		Customer c = customerDao.load(cname);
		if (c != null && c.getPasswd().equals(passwd)) {
			return c;
		}
		return null;
	}

}
